package com.probiz.estore.imports.handler.customer;

import org.apache.commons.lang.StringUtils;

import com.probiz.estore.common.model.customer.Customer;
import com.probiz.estore.common.model.system.AppUser;
import com.probiz.estore.imports.handler.ColumnHandler;
import com.probiz.estore.imports.handler.basic.ColumnBasicHandler;
import com.probiz.estore.imports.model.Column;
import com.probiz.estore.imports.model.ImportModel;

public class GenderHandler extends ColumnBasicHandler implements	ColumnHandler {

	
	public void setProperty(ImportModel importModel, Column column)	throws Exception {
		Customer customer = (Customer)importModel.getTarget();
		String value = column.getValue();
		if(StringUtils.isBlank(value))return;
		
		if(value.contains("男")){
			customer.setGender(AppUser.GENDER_MALE);
		}else if(value.contains("女")){
			customer.setGender(AppUser.GENDER_FEMALE);
		}
		//设置结果
		importModel.setResult(ImportModel.RESULT_SUCCESS);
	}

}
